<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<cpn></cpn>
		</div>
		<!-- 1.script标签,注意：类型必须是x-handlebars-template -->
		<!-- <script type="text/x-handlebars-template" id="cpn">
			<div id="">
				<h2>我是标题</h2>
				<p>我是内容，哈哈哈哈</p>
			</div>
		</script> -->
		<!-- 2.template -->
		<template id="cpn">
			<div id="">
				<h2>我是标题</h2>
				<p>我是内容，哈哈哈哈</p>
			</div>
		</template>
		<script src="../js/vue.js"></script>
		<script>
			//1.注册一个全局组件
			Vue.component('cpn',{
				template:'#cpn'
			})
			const app=new Vue({
				el:'#app',
				data:{
					message:'你好'
				}
			})
		</script>
	</body>
</html>
